package com.puyuba.puyuba.network;

import com.puyuba.puyuba.bean.CustomerLevelBean;
import com.puyuba.puyuba.bean.DownCardBean;
import com.puyuba.puyuba.bean.FindListBean;
import com.puyuba.puyuba.bean.FindPriListBean;
import com.puyuba.puyuba.bean.FindTanListBean;
import com.puyuba.puyuba.bean.GetStudentBean;
import com.puyuba.puyuba.bean.GetTeacherBean;
import com.puyuba.puyuba.bean.LevelInfoBean;
import com.puyuba.puyuba.bean.MsgDetailBean;
import com.puyuba.puyuba.bean.MsgListBean;
import com.puyuba.puyuba.bean.NeedBean;
import com.puyuba.puyuba.bean.QRcodeBean;
import com.puyuba.puyuba.bean.SwapMobileBean;
import com.pyb.java.cache.bean.UserInfoBean;
import com.pyb.java.network.ResponseEntity;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface UserApi {

    /**
     * 获取验证码
     * /v4/api/auth/send
     */
    @GET("v4/api/auth/send")
    Observable<ResponseEntity<Object>> getCellPhoneCode(@Query("mobile") String mobile);

    /**
     * 验证码登录
     * v4/api/auth/sms_login
     */
    @POST("v4/api/auth/sms_login")
    Observable<ResponseEntity<UserInfoBean>> smslogin(@Body RequestBody body);

    /**
     * 退出登录
     * v4/api/auth/logout
     */
    @POST("v4/api/auth/logout")
    Observable<ResponseEntity<Object>> logout(@Body RequestBody body);

    /**
     * 一键登录
     * v4/api/auth/mobilelogin
     */
    @POST("v4/api/auth/mobilelogin")
    Observable<ResponseEntity<UserInfoBean>> onelogin(@Body RequestBody body);

    /**
     * 发现列表
     * /v4/api/customer/list
     */
    @GET("v4/api/customer/list")
    Observable<ResponseEntity<FindListBean>> getlist(@Query("crm_user_id") int crmuserid,
                                                     @Query("category") int category);

    /**
     * 发现抢单筛选
     * /v4/api/customer/getcategorylist
     */
    @GET("v4/api/customer/getcategorylist")
    Observable<ResponseEntity<List<LevelInfoBean>>> getcategorylist();

    /**
     * 私有库列表
     * /v4/api/customer/prilist
     * category  分类id
     * edulevelid  学习层次
     */
    @GET("v4/api/customer/prilist")
    Observable<ResponseEntity<FindPriListBean>> getprilist(@Query("crm_user_id") int crmuserid,
                                                           @Query("name") String name);

    /**
     * 成交库列表
     * /v4/api/customer/gettranlist
     */
    @GET("v4/api/customer/gettranlist")
    Observable<ResponseEntity<FindTanListBean>> gettranlist(@Query("crm_user_id") int crmuserid,
                                                            @Query("name") String name);
    /**
     * 二开库列表
     * /v4/api/customer/getseclist
     */
    @GET("v4/api/customer/getseclist")
    Observable<ResponseEntity<FindPriListBean>> getseclist(@Query("crm_user_id") int crmuserid,
                                                            @Query("name") String name,
                                                            @Query("level") String level);

    /**
     * 下载名片
     * v4/api/customer/downsale
     */
    @POST("v4/api/customer/downsale")
    Observable<ResponseEntity<DownCardBean>> downsale(@Body RequestBody body);

    /**
     * 发现添加用户
     */
    @POST("v4/api/customer/add")
    Observable<ResponseEntity<Object>> add(@Body RequestBody body);

    /**
     * 发现修改用户信息
     */
    @POST("v4/api/customer/update")
    Observable<ResponseEntity<Object>> update(@Body RequestBody body);

    /**
     * 获取下载次数
     * /v4/api/customer/getdownloadtimesbyuserid
     */
    @GET("v4/api/customer/getdownloadtimesbyuserid")
    Observable<ResponseEntity<DownCardBean>> getdownloadtimesbyuserid(@Query("crm_user_id") int userid);

    /**
     * 获取客户等级
     * /v4/api/customer/getcustomerlevel
     */
    @GET("v4/api/customer/getcustomerlevel")
    Observable<ResponseEntity<List<CustomerLevelBean>>> getcustomerlevel();

    /**
     * 学生提交需求
     * /v4/api/notice/submitneed
     */
    @POST("v4/api/notice/submitneed")
    Observable<ResponseEntity<Object>> submitneed(@Body RequestBody body);

    /**
     * 查询学生
     * /v4/api/notice/getstudents
     */
    @POST("v4/api/notice/getstudents")
    Observable<ResponseEntity<GetStudentBean>> getstudents(@Body RequestBody body);

    /**
     * 查询手机号交换信息接口
     * /v4/api/notice/swapmobile
     */
    @POST("v4/api/notice/swapmobile")
    Observable<ResponseEntity<SwapMobileBean>> swapmobile(@Body RequestBody body);

    /**
     * 消息列表
     * /v4/api/notice/list
     */
    @POST("v4/api/notice/list")
    Observable<ResponseEntity<MsgListBean>> getmsglist(@Body RequestBody body);

    /**
     * 消息详情
     * /v4/api/notice/detail
     */
    @POST("v4/api/notice/detail")
    Observable<ResponseEntity<MsgDetailBean>> getmsgdetail(@Body RequestBody body);

    /**
     * 查询学生提交需求
     * /v4/api/notice/getneed
     */
    @POST("v4/api/notice/getneed")
    Observable<ResponseEntity<NeedBean>> getneed(@Body RequestBody body);

    /**
     * 查询老师
     * /v4/api/teacher/typelist
     */
    @POST("v4/api/teacher/typelist")
    Observable<ResponseEntity<GetTeacherBean>> typelist(@Body RequestBody body);

    /**
     * 获取用户数据信息
     * @return
     */
    @POST(BaseApis.GET_USER_INFO)
    Observable<ResponseEntity<String>> getUserInfo();
    /**
     * 获取下载次数
     */
    @GET("v4/api/customer/iosPayImage")
    Observable<ResponseEntity<QRcodeBean>> iosPayImage();
}
